package dp.visitor.shop;

import java.util.List;

public class ShoppingCartClient {
	public static void main(String[] args) {
		List<ItemElement> items = ObjectStruture.getList();
		
		ShoppingCartVisitor visitor = new ShoppingCartVisitorImpl();
		int sum=0;
		for(ItemElement item : items){
			sum = sum + item.accept(visitor);
		}
		
		System.out.println("Total Cost = " + sum);
	}

}
